/*
 * Copyright (c) 2013-2015 Charkey. All rights reserved.
 *
 * This software is the confidential and proprietary information of Charkey.
 * You shall not disclose such Confidential Information and shall use it only
 * in accordance with the terms of the agreements you entered into with Charkey.
 *
 * Charkey MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE SOFTWARE,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
 *
 * Charkey SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING,
 * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
 */

package cn.simastudio.talos.common.constants;

/**
 * Usage: API接口响应状态编码
 *
 * @author Charkey
 * @date 2016/5/18 20:33
 */
public class ApiStatusCode {

    // Common HTTP Status Code

    /**
     * 请求成功
     */
    public static final String OK = "200";

    /**
     * 创建成功
     */
    public static final String CREATED = "201";

    /**
     * 更新成功
     */
    public static final String ACCEPTED = "202";

    /**
     * 请求的地址不存在或者包含不支持的参数
     */
    public static final String BAD_REQUEST = "400";

    /**
     * 未授权
     */
    public static final String UNAUTHORIZED = "401";

    /**
     * 被禁止访问
     */
    public static final String FORBIDDEN = "403";

    /**
     * 请求的资源不存在
     */
    public static final String NOT_FOUND = "404";

    /**
     * 内部错误
     */
    public static final String INTERNAL_SERVER_ERROR = "500";

    // OAuth2 Status Code

    /**
     * invalid client_id or client_secret
     */
    public static final String INVALID_CLIENT = "10000";

    /**
     * unauthorized client: client is there, but unauthorized
     */
    public static final String UNAUTHORIZED_CLIENT = "10001";

    /**
     * invalid grant type
     */
    public static final String INVALID_GRANT_TYPE = "10002";

    /**
     * grant type has provided, bug unsupported
     */
    public static final String UNSUPPORTED_GRANT_TYPE = "10003";

    /**
     * invalid response type
     */
    public static final String INVALID_RESPONSE_TYPE = "10004";

    /**
     * response type has provided, but unsupported
     */
    public static final String UNSUPPORTED_RESPONSE_TYPE = "10005";

    /**
     * invalid callback url
     */
    public static final String INVALID_CALLBACK_URL = "10006";

    /**
     * invalid scope
     */
    public static final String INVALID_SCOPE = "10007";

    /**
     * scope has provided, but insufficient
     */
    public static final String INSUFFICIENT_SCOPE = "10008";

    /**
     * invalid state
     */
    public static final String INVALID_STATE = "10009";

    /**
     * invalid auth code
     */
    public static final String INVALID_AUTH_CODE = "10010";

    /**
     * invalid access token
     */
    public static final String INVALID_ACCESS_TOKEN = "10011";

    /**
     * valida access token
     */
    public static final String VALID_ACCESS_TOKEN = "10012";

    /**
     * invalid refresh token
     */
    public static final String INVALID_REFRESH_TOKEN = "10013";

    /**
     * 无效身份验证信息
     */
    public static final String INVALID_CREDENTIAL = "10014";

    /**
     * user blocked, not allowed to login
     */
    public static final String USER_BLOCKED = "10015";

    /**
     * user not exists
     */
    public static final String USER_NOT_EXISTS = "10016";

    /**
     * user try login with wrong username and password, retry exceed
     */
    public static final String RETRY_LIMIT_EXCEED = "10017";

    // Biz Status Code

    /**
     * invalid captcha
     */
    public static final String INVALID_CAPTCHA = "10050";

    /**
     * missing parameters in the request
     */
    public static final String MISSING_PARAMETER = "10051";

    /**
     * invalid extension of file, image
     */
    public static final String INVALID_EXTENSION = "10052";

    /**
     * failed to insert data into db
     */
    public static final String DATA_INSERT_FAILED = "10053";

    /**
     * failed to delete data from db
     */
    public static final String DATA_DELETE_FAILED = "10054";

    /**
     * failed to update data into db
     */
    public static final String DATA_UPDATE_FAILED = "10055";

    /**
     * failed to query data from db
     */
    public static final String DATA_QUERY_FAILED = "10056";

    /**
     * data not exists
     */
    public static final String DATA_NOT_EXISTS = "10057";

    /**
     * failed update status of record
     */
    public static final String STATUS_UPDATE_FAILED = "10058";

    /**
     * 缺失系统组件，比如可配置的ucpaas
     */
    public static final String MISSING_COMPONENT = "10059";

    /**
     * 无效参数
     */
    public static final String INVALID_PARAMETER = "10060";

    // General Status Code

    /**
     * general error/exception code
     */
    public static final String GENERAL_EXCEPTION = "19000";

}
